package net.roobook.cms.modules.admin.entity;

import net.roobook.cms.common.entity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author cos
 * @email 327878610@qq.com
 * @link https://roobook.net
 * @Description 用户
 * @date 2023/9/24 11:03
 **/
@Table(name = "sys_user")
public class User extends BaseEntity<User> {

    @Column(name = "username")
    private String username;        // 登录账号

    @Column(name = "password")
    private String password;        // 登录密码

    @Column(name = "mobile")
    private String mobile;          // 手机号

    @Column(name = "realname")
    private String realname;        // 名字

    @Column(name = "status")
    private Integer status;         // 状态

    @Column(name = "salt")
    private String salt;            // 盐

    @Column(name = "last_login_ip")
    private String lastLoginIp;     // 最近登录IP

    @Column(name = "last_login_time")
    private Date lastLoginTime;     // 最近登录时间

    @Column(name = "portrait")
    private String portrait;        // 肖像

    public User() {
    }

    public User(User user) {
        super();
        this.username = user.getUsername();
        this.password = user.getPassword();
        this.mobile = user.getMobile();
        this.realname = user.getRealname();
        this.status = user.getStatus();
        this.salt = user.getSalt();
        this.lastLoginIp = user.getLastLoginIp();
        this.lastLoginTime = user.getLastLoginTime();
        this.portrait = user.getPortrait();
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }


    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getPortrait() {
        return portrait;
    }

    public void setPortrait(String portrait) {
        this.portrait = portrait;
    }

}
